//获取应用实例
const app = getApp();

Page({
  data: {
    goods:[],
    lo:'https://xiaochengxu.printeasy.top',
    // 组件所需的参数
    nvabarData: {
      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
      title: '设备采购', //导航栏 中间的标题
    },
    // 此页面 页面内容距最顶部的距离
    height: app.globalData.height * 2 + 20,
  },
  onLoad() {
    let url = app.globalData.URL+'goods/commodity/type/list?type=0';
    let data = {};
    let that = this;
    app.wxRequest('GET', url, data, (res) => {
      let goods = res.rows
      that.setData({
        goods:goods
      })
      console.log(goods)
    }, (err) => {
      console.log(err.errMsg)
    })
  },
  gopurchase_details:function(e){
    let that = this;
    let id = e.currentTarget.dataset.id;
    let typeid = 0;
    wx.navigateTo({
      url: '/modelA/pages/equipment_procurement/purchase_details/purchase_details?id='+id+'&typeid='+typeid,
      success: function(res) {},
      fail: function(res) {},
      complete: function(res) {},
    })
  }
  
})
